package cn.wen.yinxiu.member.dao;

import cn.wen.yinxiu.member.entity.GroupEntity;
import cn.wen.yinxiu.member.vo.GroupInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 
 *
 * @ClassName: GroupDao
 * @Author 小飞
 * @Email coderwen22@163.com
 * @Date 2023-05-21 22:19:26
 * @Description: 聊天群组Dao层
 */
@Component
@Mapper
public interface GroupDao extends BaseMapper<GroupEntity> {


    /**
     * 通过用户Id获取该用户的全部群组基本信息
     * @param userId
     * @param status
     * @param isDeleted
     * @return
     */
    List<GroupInfo> selectUserGroupListByUserId(@Param("userId") Long userId,
                                                @Param("status") Integer status,
                                                @Param("isDeleted") Integer isDeleted);

    /**
     * 获取用户群组ID列表
     * @param userId
     * @param status
     * @param isDeleted
     * @return
     */
    List<Long> selectUserGroupIdList(@Param("userId") Long userId,
                                     @Param("status") Integer status,
                                     @Param("isDeleted") Integer isDeleted);
}
